package com.minsf.springbootinit.dcl;

import cn.hutool.system.oshi.OshiUtil;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.util.logging.MemoryHandler;

/**
 * @Description
 * @Author minify
 * @Date 2024/1/2 16:30
 * @Project oj-backend
 */
public class LazyUC {

    @Test
    @DisplayName("懒汉式双检锁测试")
    public void testGetLazy() {
        for (int i = 0; i < 1000; i++) {
            Thread iThread = new Thread(() -> {
                Lazy instance = Lazy.getInstance();
            }, i+"iThread");
            iThread.start();
        }
    }
}
